/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author david.carranza
 */
@Entity
@Table(name = "cex_resultado_laboratorio")
@NamedQueries({
    @NamedQuery(name = "CexResultadoLaboratorio.findAll", query = "SELECT c FROM CexResultadoLaboratorio c")})
public class CexResultadoLaboratorio implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "crl_id")
    private Integer crlId;
    @JoinColumn(name = "cpl_id", referencedColumnName = "cpl_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private CexPedidoLaboratorio cexPedidoLaboratorio;
    @JoinColumn(name = "ctl_id", referencedColumnName = "ctl_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private CexTipoExamenLaboratorio cexTipoExamenLaboratorio;

    public CexResultadoLaboratorio() {
    }

    public CexResultadoLaboratorio(Integer crlId) {
        this.crlId = crlId;
    }

    public Integer getCrlId() {
        return crlId;
    }

    public void setCrlId(Integer crlId) {
        this.crlId = crlId;
    }

    public CexPedidoLaboratorio getCexPedidoLaboratorio() {
        return cexPedidoLaboratorio;
    }

    public void setCexPedidoLaboratorio(CexPedidoLaboratorio cexPedidoLaboratorio) {
        this.cexPedidoLaboratorio = cexPedidoLaboratorio;
    }

    public CexTipoExamenLaboratorio getCexTipoExamenLaboratorio() {
        return cexTipoExamenLaboratorio;
    }

    public void setCexTipoExamenLaboratorio(CexTipoExamenLaboratorio cexTipoExamenLaboratorio) {
        this.cexTipoExamenLaboratorio = cexTipoExamenLaboratorio;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (crlId != null ? crlId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CexResultadoLaboratorio)) {
            return false;
        }
        CexResultadoLaboratorio other = (CexResultadoLaboratorio) object;
        if ((this.crlId == null && other.crlId != null) || (this.crlId != null && !this.crlId.equals(other.crlId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "newpackage.CexResultadoLaboratorio[ crlId=" + crlId + " ]";
    }
    
}
